import $api from "@/api/index";
import { TokenI } from "@/models/user";

export async function login(name: string, password: string): Promise<TokenI> {
  const res = await $api.post("api/token/", {
    username: name,
    password,
  });

  return res.data;
}
